In this case, the scripts are functional, but the first time I type the location of .js file, I can get it open. Only when I refresh the page that I get redirected. I really can't understand why this happens...
I find this really useful to block hotlinks, but it's not always bloking type-in requests.
By the way, I have no access to apache configuration.
Question
andressito
Hi everyone,
I'm trying to use the .htaccess file to prevent type-in access to .js (javascript) files which are located in a /scripts folder
with:
I can block type-in access, but the pages cannot use the scripts. I add "Allow from 127.0.0.1" but no results.
I also tried:
Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://mydomain.* [NC] RewriteRule .*\.(js)$ http://mydomain.com [R,L]
In this case, the scripts are functional, but the first time I type the location of .js file, I can get it open. Only when I refresh the page that I get redirected. I really can't understand why this happens...
I find this really useful to block hotlinks, but it's not always bloking type-in requests.
By the way, I have no access to apache configuration.
Any help would be appreciated.
Thanks
Link to comment
https://www.neowin.net/forum/topic/905644-prevent-access-to-files-using-htaccess/Share on other sites
7 answers to this question
Recommended Posts